package com.acme.net;

import java.io.IOException;
import java.io.ObjectOutputStream;
import java.io.Writer;

public class Util {
    public static void echo(String s) {
        System.out.println(s);
    }

    public static void sendMessage(String hostName, ObjectOutputStream writer, String msg) {
        try {
            writer.writeObject(msg);
            writer.flush();
            echo(hostName + msg);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}